<?php
/*
 * @Author: CHINAKAIYUAN<sunkaiyuan@namenode.cn>
 * @Date: 2022-02-03 01:16:57
 * @LastEditTime: 2023-10-19 16:15:01
 * @LastEditors: 孙开源 && sunkaiyuan@namenode.cn
 * @Description: 盘点单
 */

namespace App\Models;

use App\Traits\StorageTrait;
use App\Traits\CarTrait;
use App\Traits\CarryTrait;
use App\Traits\SoftDeletesTrait;

class MpcAllocationDetail extends BaseModel
    {
    use SoftDeletesTrait;
    use StorageTrait;
    use CarryTrait;
    use CarTrait;
    public $timestamps = true;
    public $table = "sys_mpc_allocation_detail";
    protected $guarded = [];
    protected $casts = [
        'price'              => 'decimal:2',
        'quantity'           => 'decimal:2',
        'auxiliary_quantity' => 'decimal:2',
    ];

    public function main()
        {
        return $this->belongsTo(MpcAllocation::class);
        }

    public function type()
        {
        return $this->belongsTo(Type::class);
        }
    public function lot()
        {
        return $this->belongsTo(MpcLot::class);
        }
    public function oldlocation()
        {
        return $this->belongsTo(MpcLocation::class);
        }
    }